//
//  Array+Base64.swift
//  NyamanDana
//
//  Created by 李永彬 on 2025/11/4.
//

import Foundation

extension Array where Element == [String: Any] {
    func toBase64String(options: JSONSerialization.WritingOptions = []) -> String? {
        do {
            let jsonData = try JSONSerialization.data(withJSONObject: self, options: options)
            return jsonData.base64EncodedString()
        } catch {
            print("[Base64转换失败] \(error.localizedDescription)")
            return nil
        }
    }
}
